Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DataProducersNodeHashCodeToSdfPathRegistry with path mapping. #247

Conversation

ppt-adsk
Copy link
Collaborator

In the code coverage build the DataProducersNodeHashCodeToSdfPathRegistry was not being cleared out properly on file new, and finding out why was challenging. Instead, use the path mapping infrastructure to avoid the need for DataProducersNodeHashCodeToSdfPathRegistry in the Maya scene index.

@ppt-adsk ppt-adsk self-assigned this Feb 10, 2025
_sceneIndexPathPrefix(sceneIndexPathPrefix)
{}

PrimSelections PrefixPathMapper::UfePathToPrimSelections(const Ufe::Path& appPath) const
{
// We only handle scene items from our assigned run time ID.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the important changes in this pull request. Restricting the path mapper to only deal with one kind of UFE data model is overly restrictive, because the main point is mapping a Ufe::Path prefix into a Hydra scene index SdfPath prefix, regardless of which data model(s) are involved. This was making the path mapping overly complex.

// No need for a path mapper: the parts of the footprint are not selectable
// individually, only the Maya shape, so the built-in Maya path mapper does
// the job of path mapping for the footprint node.
// Register a path mapper to map application UFE paths to scene index paths,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove reliance on DataProducersNodeHashCodeToSdfPathRegistry, use path mapping instead, as is done in FlowViewportAPILocator.

@@ -788,20 +790,15 @@ Fvp::PrimSelections MayaHydraSceneIndex::UfePathToPrimSelections(const Ufe::Path
MDagPath shapeDagPath(dagPath);
shapeDagPath.extendToShape();

// Check if this Maya node has a special path mapper associated with it.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove reliance on DataProducersNodeHashCodeToSdfPathRegistry, use path mapping instead.

@@ -331,18 +333,19 @@ Fvp::PrimSelections MayaUsdProxyShapeSceneIndex::UfePathToPrimSelections(
const Ufe::Path& appPath
) const
{
// We only handle USD objects, so if the UFE path is not a USD object,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove single UFE run-time restriction, path mapping should only deal with paths.

@@ -1,5 +1,5 @@
//
// Copyright 2024 Autodesk
// Copyright 2025 Autodesk
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need to change the year since this file was created in 2024, but it's very minor.

@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 11, 2025
@lilike-adsk lilike-adsk merged commit f7dffda into dev Feb 11, 2025
10 checks passed
@lilike-adsk lilike-adsk deleted the tremblp/HYDRA-1134/fix_testFootPrintNode_coverage_test_failure branch February 11, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants